package com.course02.order_backend.exception.llh;

import lombok.Getter;

//确定出错的详细信息发送给日志记录
@Getter
public class BusinessException extends RuntimeException{//RuntimeException是java包自带运行异常，减少try catch编写
    private final ErrorCode errorCode;//获取枚举对象
    private final String detail;//获取详细信息
    public BusinessException(ErrorCode errorCode,String detail){
        super(errorCode.getMessage()+"("+detail+")");//调用RuntimeException父类的构造方法
        this.errorCode=errorCode;
        this.detail=detail;//传递枚举

    }
}
